/* ClientTai.java 
* Created on Dec 20, 2012 
* Author:Mr.Viet
* Phone: 01683430426
* Email: phamvanvietcdhd@gmail.com
*/ 
package com.session9; 

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

public class ClientTai extends Thread {
	private Socket client;
	private boolean running = true;
	private BufferedReader reader;
	public ClientTai(Socket client) {
		this.client = client;
		try {
			this.reader = new BufferedReader(new InputStreamReader(client.getInputStream()));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	@Override
	public void run() {
		while(running){
			String str = null;
			try {
				while((str=reader.readLine())!=null){
					System.out.println("Client"+str);
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
